from django.conf import settings
from django.contrib.auth.models import User, check_password

from django.contrib.auth.backends import RemoteUserBackend

class NameBackend(RemoteUserBackend):
  def get_user(self, username):
    try:
      return User.objects.get(username=username)
    except User.DoesNotExist:
      return None
      
  def configure_user(self, user):
    return user  
